﻿using System.Windows.Forms;

namespace ProjectN.Debug
{
    public static partial class Utilities
    {
        public static IDebugOutput createDebugOutpt(Form form)
        {
            if (ProjectN.Properties.Settings.Default.Debug)
                return DebugOutputBox.createFrom(form);
            else
                return new FakeDebugOutput();
        }

        private static IDebugOutput generalDebugOutput;
        public static IDebugOutput GeneralDebugOutput
        {
            get
            {
                if (generalDebugOutput == null || !generalDebugOutput.IsActive)
                    GeneralDebugOutput = createDebugOutpt(null);
                return generalDebugOutput;
            }

            private set
            {
                generalDebugOutput = value;
            }
        }
    }
}
